package com.itheima.advantagesup.mapper;

import com.github.pagehelper.Page;
import com.itheima.advantagesup.dto.AddArticleDTO;
import com.itheima.advantagesup.entity.YddArticle;
import com.itheima.advantagesup.vo.AddArticleVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Du leilei
 */
@Mapper
public interface YddArticleMapper {

    /**
     * 页面查询
     *
     * @param yddArticle ydd文章
     * @return {@link Page}<{@link YddArticle}>
     */
    Page<YddArticle> pageQuery(YddArticle yddArticle);


    /**
     * 插入
     *
     * @param yddArticle ydd文章
     * @return {@link AddArticleDTO}
     */
    void insert(YddArticle yddArticle);

    @Delete("delete from ydd_article where id=#{id} ")
    void delArticle(Integer id);


    @Select("select * from ydd_article where id=#{id}")
    YddArticle selectArticle(Integer id);

    /**
     * 更新文章
     *
     * @param yddArticle ydd文章
     */
    void updateArticle(YddArticle yddArticle);

}
